package com.ruoyi.course.service.impl;

import java.util.List;

import com.ruoyi.common.constant.SysConstants;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.SysStudentTopicMapper;
import com.ruoyi.course.domain.SysStudentTopic;
import com.ruoyi.course.service.ISysStudentTopicService;

/**
 * 课程题目Service业务层处理
 * 
 * @author YJF
 */
@Service
public class SysStudentTopicServiceImpl implements ISysStudentTopicService 
{
    @Autowired
    private SysStudentTopicMapper sysStudentTopicMapper;

    /**
     * 查询课程题目
     * 
     * @param studentTopicId 课程题目主键
     * @return 课程题目
     */
    @Override
    public SysStudentTopic selectSysStudentTopicByStudentTopicId(Long studentTopicId)
    {
        return sysStudentTopicMapper.selectSysStudentTopicByStudentTopicId(studentTopicId);
    }

    /**
     * 查询课程题目列表
     * 
     * @param sysStudentTopic 课程题目
     * @return 课程题目
     */
    @Override
    public List<SysStudentTopic> selectSysStudentTopicList(SysStudentTopic sysStudentTopic)
    {
        sysStudentTopic.setDelFlag(SysConstants.CONSTANT_STR0);
        return sysStudentTopicMapper.selectSysStudentTopicList(sysStudentTopic);
    }

    /**
     * 新增课程题目
     * 
     * @param sysStudentTopic 课程题目
     * @return 结果
     */
    @Override
    public int insertSysStudentTopic(SysStudentTopic sysStudentTopic)
    {
        sysStudentTopic.setCreateTime(DateUtils.getNowDate());
        return sysStudentTopicMapper.insertSysStudentTopic(sysStudentTopic);
    }

    /**
     * 修改课程题目
     * 
     * @param sysStudentTopic 课程题目
     * @return 结果
     */
    @Override
    public int updateSysStudentTopic(SysStudentTopic sysStudentTopic)
    {
        sysStudentTopic.setUpdateTime(DateUtils.getNowDate());
        return sysStudentTopicMapper.updateSysStudentTopic(sysStudentTopic);
    }

    /**
     * 批量删除课程题目
     * 
     * @param studentTopicIds 需要删除的课程题目主键
     * @return 结果
     */
    @Override
    public int deleteSysStudentTopicByStudentTopicIds(Long[] studentTopicIds)
    {
        return sysStudentTopicMapper.deleteSysStudentTopicByStudentTopicIds(studentTopicIds);
    }

    /**
     * 删除课程题目信息
     * 
     * @param studentTopicId 课程题目主键
     * @return 结果
     */
    @Override
    public int deleteSysStudentTopicByStudentTopicId(Long studentTopicId)
    {
        return sysStudentTopicMapper.deleteSysStudentTopicByStudentTopicId(studentTopicId);
    }
}
